package club.calong.sanniu.util;

import java.util.Calendar;

public class Utils {

    public static String generateFileName (String path, String suffix) {

        return path +
                Calendar.getInstance().getTimeInMillis() +
                (int) (Math.random() * 10) +
                "." +
                suffix;
    }

    public static String generateCode (int size) {

        StringBuilder code = new StringBuilder();
        for (int i = 0; i < size; i++) {
            code.append((int) (Math.random() * 10));
        }
        return code.toString();
    }
}
